<!DOCTYPE html>
<html>
<head>
  <title>Biblioteca Virtual</title>
  <%= stylesheet_link_tag    "application" %>
  <%= javascript_include_tag "application" %>
  <%= csrf_meta_tags %>		
</head>
<body>

 <div class="conteudo">

	 <div class="topo">
		<div class="cabecalho">
			<%=  image_tag("Logo_superior.gif", :size=> "240x50")   %>  
		</div>
		<div class="box-login">
			<% if session[:logged] %>
				<span>Ola, <%=session[:username]%>, seja bem-vindo.</span>
				<%=link_to "", session_path(1), :method => :delete %>
			<% end %>
		</div>
	 </div>
	<div class="clear"></div>
	 <div class="corpo">
		<div class="menu-superior">
			<% if session[:logged] %>
				<% if session[:tipo].upcase == 'ADM' %>
					<ul>
						<li><%=link_to "HOME", root_path %></li>
						<li><%=link_to "EDITORAS", editoras_path %></li>
						<li><%=link_to "LIVROS", livros_path %></li>
						<li><%=link_to "PASTA NA XEROX", pastas_path %></li>
						<li><%=link_to "USUARIOS", users_path %></li>
					</ul>
				<% elsif session[:tipo].upcase == 'ALUNO' %>
					<ul>
						<li><%=link_to "HOME", root_path %></li>
						<li><%=link_to "LIVROS", livros_path %></li>
					</ul>
				<% elsif session[:tipo].upcase == 'PROF' %>
					<ul>
						<li><%=link_to "HOME", root_path %></li>
						<li><%=link_to "LIVROS", livros_path %></li>
						<li><%=link_to "EDITORAS", editoras_path %></li>
						<li><%=link_to "PASTA NA XEROX", pastas_path %></li>
					</ul>
				<% end %>
				
			
			<% end %>
		</div>
		
		<div class="breadcrumb">
			<% if session[:logged]%>
				<span>Voce esta aqui: </span><%=render_breadcrumbs%>
			<% end %>
		</div>
		<div class="clear"></div>
		<div class="corpo-sub">
			<div class="menu-lateral">
				<% if session[:logged] %>
					<span>MENU</span>
					<% if @current_controller == "livros" %>
						<ul>
							<li><%=link_to "Buscar Livros", :controller => "livros", :action => "search" %></li>
							<% if session[:tipo].upcase == 'ADM' %>
							<li><%=link_to "Cadastrar Novo Livro", :controller => "livros", :action => "new" %></li>
							<% end%>
						</ul>
					<% elsif @current_controller == "editoras" %>
						<ul>
							<li><%=link_to "Visualizar Editoras", :controller => "editoras", :action => "index" %></li>
							<li><%=link_to "Cadastrar Nova Editora", :controller => "editoras", :action => "new" %></li>
						</ul>
					<% else %>
						<ul>
							<li><a><%=@current_controller%></a></li>
						</ul>
					<% end %>				
				<% end %>
			</div>
			<div class="conteudo-sub">
				<%= yield %>
			</div>
		</div>
	 </div>
		<div class="clear"></div>
	 <div class="rodape">
			<ul>
				<li><span>Trabalho de Organizacao de Computadores II</span></li>
				<li><span>Prof: Vinod Rabello</span></li>
				<li><span>Alunos:</span></li>
						<li><span>Augusto Consulmagnos,Bernardo Juncal,Bruno Coimbra,Marcos Almeida,Leonardo Araujo,Raphael Bottino</span></li>					
			</ul>
	 </div>
	 
  </div>
</body>
</html>
